package com.song.pojo;

import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @Author 宋伟宁
 * @Date 2023/9/14
 * @Version 1.0
 * 主键的作用：通知spring容器，我是bean
 **/
@Component
@PropertySource(value = {"classpath:user.properties"})
@Data
public class User {

    @Value("${name}")
    private String name;
    @Value("${age}")
    private int age;
}
